package cn.com.system.service.impl;

import java.util.List;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import cn.com.system.mapper.SysUserIdentityMapper;
import cn.com.common.constants.Constants;
import cn.com.system.entity.SysUserIdentityEntity;
import cn.com.system.service.SysUserIdentityService;


@Service("sysUserIdentityService")
public class SysUserIdentityServiceImpl extends ServiceImpl<SysUserIdentityMapper, SysUserIdentityEntity> implements SysUserIdentityService {

	/* (non-Javadoc)
	 * @see cn.com.system.service.SysUserIdentityService#getUserIdentityById(java.lang.String)
	 */
	@Override
	public List<SysUserIdentityEntity> getUserIdentityById(String userId) {
		LambdaQueryWrapper<SysUserIdentityEntity> lambdaQuery = Wrappers.lambdaQuery();
		List<SysUserIdentityEntity> list = this
				.list(lambdaQuery.eq(SysUserIdentityEntity::getUserId, userId)
						.eq(SysUserIdentityEntity::getDeleted, Constants.DELETEED_NOT)
						.eq(SysUserIdentityEntity::getMainFlag, "Y"));
		return list;
	}


}